package com.fr.report.web.ui;

import com.fr.base.FCloneable;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.Report;
import com.fr.report.WorkSheet;
import com.fr.web.Repository;

public class CustomComposite extends Composite
{
  protected Report report;

  public Report getReport(Repository paramRepository)
  {
    return this.report;
  }

  public void setReport(Report paramReport)
  {
    this.report = paramReport;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if (str.equals("Report"))
      {
        WorkSheet localWorkSheet = new WorkSheet();
        localWorkSheet.readXML(paramXMLableReader);
        setReport(localWorkSheet);
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Report");
    this.report.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    CustomComposite localCustomComposite = (CustomComposite)super.clone();
    if (this.report != null)
      localCustomComposite.report = ((Report)this.report.clone());
    return localCustomComposite;
  }

  public boolean equals(Object paramObject)
  {
    if ((paramObject == null) || (!(paramObject instanceof CustomComposite)))
      return false;
    return ((super.equals(paramObject)) && (ComparatorUtils.equals(this.report, ((CustomComposite)paramObject).report)));
  }
}